package com.test.pack1.demo.base2_1;

/**
 * Created by dws on 2017/12/14.
 * 插入排序
 */
public class Insertion {

    public static void sort(Comparable[] a){
        int N = a.length;

        for(int i=1;i<N;i++){
            for(int j = i; j>0&& Selection.less(a[j],a[j-1]); j--){
                Selection.exch(a,j,j-1);
            }
        }

    }
}
